<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/pages/common/includes/taglibs.jsp" %>
<security:authentication var="AUTHORITIES" property="principal" />
<security:authorize ifAllGranted="ROLE_USER">
  <security:authentication var="LOGIN_USER_ID" property="principal.user.id" />
</security:authorize>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<title>HEADER</title>
</head>
<body>
<div id="header">
  <div id="account">
      <security:authorize ifAllGranted="ROLE_USER">
        <c:url var="DASHBOARD_URL" value="/dashboard.html" />
        <c:url var="MYPROFILE_URL" value="/users/${LOGIN_USER_ID}.html" />
        <c:url var="LOGOUT_URL" value="/logout" />
        <p>ようこそ、<security:authentication property="principal.user.username" />&nbsp;さん&nbsp;&nbsp;|&nbsp;&nbsp;<a href="${DASHBOARD_URL}">ダッシュボード</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="${MYPROFILE_URL}">プロファイル</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="${LOGOUT_URL}">ログアウト</a></p>
      </security:authorize>
      <security:authorize ifNotGranted="ROLE_USER">
        <c:url var="USER_FORM_URL" value="/users/form.html" />
        <c:url var="LOGIN_URL" value="/login.html" />
        <p>ようこそ、ゲストさん&nbsp;&nbsp;|&nbsp;&nbsp;<a href="${USER_FORM_URL}">新規会員登録</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="${LOGIN_URL}">ログイン</a></p>
      </security:authorize>
  </div>
  <div class="container">
    <div id="logo">
      <a href="<c:url value='/' />" style="font-size: 1.4em; color: #000; margin: 0.2em 0.7em;">病院薬局間情報連携システム</a>
    </div>
  </div>
</div>
</body>
</html>